home *** CD-ROM | disk | FTP | other *** search
/ Robotics & Artificial Int…3 (Professional Edition) / Robotics & Artificial Intelligence Tools 2003 (Professional Edition).iso / neural network tool and application / nsinstall.exe / data1.cab / DllSys_Files / CONTAXON / INTEGA.C < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-08  |  1.3 KB  |  41 lines

  1. // Dynamic link library implementation of NeuroSolutions IntegratorAxon component 
  2.  
  3. #include "NSDLL.h"
  4.  
  5. /***********************************/
  6. /* Forward activation of component */
  7.  
  8. __declspec(dllexport) void performContextAxon(
  9.     DLLData *instance,        // Pointer to instance data (may be NULL)
  10.     NSFloat    *data,             // Pointer to the layer of processing elements (PEs)
  11.     int     rows,            // Number of rows of PEs in the layer
  12.     int     cols,            // Number of columns of PEs in the layer
  13.     NSFloat    *delayedData,     // Pointer to a PE layer delayed by a single time step
  14.     NSFloat    *tau,            // Pointer to a vector of time constants, one for each PE
  15.     NSFloat    beta            // Linear scaling factor controlled within the components inspector
  16.     )
  17. {
  18.     int i, length=rows*cols; 
  19.  
  20.     for (i=0; i<length; i++)
  21.         data[i] = (NSFloat)(beta * ((1.0-tau[i])*data[i] + tau[i]*delayedData[i]));
  22. }
  23.  
  24. /******************************************/
  25. /* Management of instance data (OPTIONAL) */
  26. /*
  27. __declspec(dllexport) DLLData *allocContextAxon(
  28.     DLLData    *oldInstance,    // Pointer to the last instance if reallocating
  29.     int     rows,        // Number of rows of PEs in the layer
  30.     int     cols        // Number of columns of PEs in the layer
  31.     )
  32. {
  33.     DLLData *instance = allocDLLInstance(oldInstance);
  34.     return instance;
  35. }
  36.  
  37. __declspec(dllexport) void freeContextAxon(DLLData *instance)
  38. {
  39.     freeDLLInstance(instance);
  40. }
  41. */